from django.db import models


class Colleges(models.Model):
    college_id = models.BigAutoField(db_column='College_Id', primary_key=True)
    collegename = models.CharField(db_column='CollegeName', max_length=255, blank=True, null=True)
    gentime = models.DateTimeField(db_column='Gentime')

    class Meta:
        db_table = 'college'
        verbose_name_plural = '院校记录表'


class Experts(models.Model):
    experts_id = models.BigAutoField(primary_key=True, db_column='experts_id')
    experts_name = models.CharField(max_length=255, db_column='experts_name')
    user_id = models.ForeignKey('aiauth.Users', models.DO_NOTHING, blank=True, null=True, db_column='user_id')
    create_time = models.DateTimeField(db_column='create_time')
    update_time = models.DateTimeField(blank=True, null=True, db_column='update_time')
    status = models.IntegerField(blank=True, null=True, db_column='status')
    careerplan_count = models.IntegerField(blank=True, null=True, db_column='careerplan_count')
    can_del = models.BooleanField(blank=True, default=False, db_column='can_del')

    class Meta:
        db_table = 'experts'
        verbose_name_plural = '职业规划专家表'


class Organizations(models.Model):
    organization_id = models.BigAutoField(db_column='Organization_Id', primary_key=True)
    parenttoid = models.ForeignKey('Colleges', models.DO_NOTHING, db_column='ParentToId')
    orggrade = models.CharField(db_column='OrgGrade', max_length=8, blank=True, null=True)
    orgname = models.CharField(db_column='OrgName', max_length=64)
    description = models.CharField(db_column='Description', max_length=200, blank=True, null=True)
    del_field = models.BooleanField(db_column='Del', blank=True, null=True)
    gentime = models.DateTimeField(db_column='GenTime')

    class Meta:
        db_table = 'organization'
        verbose_name_plural = '组织表'


class Positions(models.Model):
    position_id = models.BigAutoField(db_column='Position_Id', primary_key=True)
    position_name = models.CharField(db_column='Position_Name', max_length=20, blank=True, null=True)
    del_field = models.BooleanField(db_column='Del', blank=True, null=True)
    gentime = models.DateTimeField(db_column='Gentime')

    class Meta:
        db_table = 'position'
        verbose_name_plural = '职业表'


class Timeslot(models.Model):
    timeslot_id = models.BigAutoField(primary_key=True, db_column='timeslot_id')
    name = models.CharField(max_length=255)
    create_time = models.DateTimeField()
    update_time = models.DateTimeField(blank=True, null=True)
    status = models.BooleanField(blank=True, null=True)
    timeslot_count = models.IntegerField(blank=True, null=True)
    can_del = models.BooleanField(blank=True, null=True)

    class Meta:
        db_table = 'timeslot'
        verbose_name_plural = '职业规划时段表'


class Userinfo(models.Model):
    userinfo_id = models.BigAutoField(db_column='UserInfo_Id', primary_key=True)
    organization = models.ForeignKey('Organizations', models.DO_NOTHING, db_column='Organization_Id', blank=True,
                                     null=True)
    position = models.ForeignKey('Positions', models.DO_NOTHING, db_column='Position_Id')
    pic = models.CharField(db_column='Pic', max_length=20, blank=True, null=True)
    sex = models.BooleanField(db_column='Sex', blank=True, null=True)
    age = models.IntegerField(db_column='Age', blank=True, null=True)
    birthday = models.DateField(db_column='Birthday', blank=True, null=True)
    idnumber = models.CharField(db_column='IdNumber', max_length=20, blank=True, null=True)
    placeoforigin = models.CharField(db_column='PlaceOfOrigin', max_length=20, blank=True, null=True)
    school = models.CharField(db_column='School', max_length=30, blank=True, null=True)
    educational = models.CharField(db_column='Educational', max_length=20, blank=True, null=True)
    nation = models.CharField(db_column='Nation', max_length=10, blank=True, null=True)
    politicalvisage = models.CharField(db_column='PoliticalVisage', max_length=10, blank=True, null=True)
    postalcode = models.CharField(db_column='PostalCode', max_length=20, blank=True, null=True)
    qqnumber = models.CharField(db_column='QQNumber', max_length=20, blank=True, null=True)
    gentime = models.DateTimeField(db_column='GenTime')
    edittime = models.DateTimeField(db_column='EditTime')

    class Meta:
        db_table = 'userinfo'
        verbose_name_plural = '用户信息表'
